package com.trickytriads.services.mock
{
	import com.trickytriads.events.LoadNewsEvent;
	import com.trickytriads.model.NewsData;
	import com.trickytriads.services.interfaces.I_NewsService;
	
	import flash.events.EventDispatcher;

	/**
	 * Mock news service, provides sample data.
	 **/
	[Event(name="newsLoadDone", type="com.trickytriads.events.LoadNewsEvent")]
	[ManagedEvents("newsLoadDone")]
	public class NewsServiceImpl_Mock extends EventDispatcher implements I_NewsService
	{	
		public function NewsServiceImpl_Mock()
		{
		}

		public function loadNewsItem(newsid:int):void
		{
			var mockNewsItem:NewsData
				= new NewsData(1, new Date(2010, 6, 20), "Mike", "Mock news item.", "Mock news title.");
			// Make an event result and toss it into the system
			var mockEventResult:LoadNewsEvent = new LoadNewsEvent(LoadNewsEvent.NEWS_LOAD_DONE, 0);
			mockEventResult.news = mockNewsItem;
			// Dispatch the resulting news into the system
			dispatchEvent(mockEventResult);
		}
		
		public function loadAllNews():void
		{
		}
		
	}
}